/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.base.entity.guarantor;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * 担保方Entity
 * @author lv
 * @version 2021-02-24
 */
@Table(name="t_guarantor", alias="a", columns={
        @Column(name="guarantor_id", attrName="guarantorId", label="担保方编号", isPK=true,queryType=QueryType.LIKE),
        @Column(name="guarantor_name", attrName="guarantorName", label="名称", queryType=QueryType.LIKE),
        @Column(name="id_number", attrName="idNumber", label="身份证号", queryType=QueryType.LIKE),
        @Column(name="phone", attrName="phone", label="电话", isQuery=false),
        @Column(name="email", attrName="email", label="邮箱", isQuery=false),
        @Column(name="address", attrName="address", label="地址", isQuery=false),
        @Column(name="remarks", attrName="remarks", label="备注", isQuery=false),
        @Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false),
        @Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false),
        @Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
        @Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false),
},joinTable = {
        @JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = User.class, attrName = "createByUser", alias = "createby",
                on = "createby.user_code = a.create_by", columns = {
                @Column(name = "user_code", label = "用户编码", isPK = true),
                @Column(name = "user_name", label = "用户名称", isQuery = false),
        }),
        @JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = User.class, attrName = "updateByUser", alias = "updateby",
                on = "updateby.user_code = a.update_by", columns = {
                @Column(name = "user_code", label = "用户编码", isPK = true),
                @Column(name = "user_name", label = "用户名称", isQuery = false),
        }),
}, orderBy="a.update_date DESC"
)
public class Guarantor extends DataEntity<com.jeesite.modules.base.entity.guarantor.Guarantor> {

    private static final long serialVersionUID = 1L;
    private String guarantorId;		// 担保方编号
    private String guarantorName;		// 名称
    private String idNumber;		// 身份证号
    private String phone;		// 电话
    private String email;		// 邮箱
    private String address;		// 地址
    private User createByUser;
    private User updateByUser;

    public Guarantor() {
        this(null);
    }

    public Guarantor(String id){
        super(id);
    }

    public String getGuarantorId() {
        return guarantorId;
    }

    public void setGuarantorId(String guarantorId) {
        this.guarantorId = guarantorId;
    }

    @NotBlank(message="名称不能为空")
    @Length(min=0, max=100, message="名称长度不能超过 100 个字符")
    public String getGuarantorName() {
        return guarantorName;
    }

    public void setGuarantorName(String guarantorName) {
        this.guarantorName = guarantorName;
    }

    @Length(min=0, max=100, message="身份证号长度不能超过 100 个字符")
    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    @Length(min=0, max=100, message="电话长度不能超过 100 个字符")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Length(min=0, max=100, message="邮箱长度不能超过 100 个字符")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Length(min=0, max=200, message="地址长度不能超过 200 个字符")
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }


    public User getCreateByUser() {
        return createByUser;
    }

    public void setCreateByUser(User createByUser) {
        this.createByUser = createByUser;
    }

    public User getUpdateByUser() {
        return updateByUser;
    }

    public void setUpdateByUser(User updateByUser) {
        this.updateByUser = updateByUser;
    }
}